package net.da;

import com.google.inject.AbstractModule;
import com.google.inject.Scopes;

import net.da.core.manager.BusinessObjectManagerImpl;
import net.da.core.manager.BusinessObjectManager;
import net.da.core.manager.EntityManagerFactoryProvider;

import javax.persistence.EntityManagerFactory;

public class ProductionInjectionConfiguration extends AbstractModule {

    protected void configure() {
        // JPA entity maanger factory creator
        // See http://www.wideplay.com/guicewebextensions2 for more flexible support in future
        bind(EntityManagerFactory.class).toInstance(new EntityManagerFactoryProvider().get());

        bind(BusinessObjectManager.class).to(BusinessObjectManagerImpl.class).in(Scopes.SINGLETON);

   }

}
